import type { Station as MapStation } from '@/components/MapView/Mapless/index.d';
import type { Station } from '@/types/common';

// TODO 最终要去掉适配函数

export const Station2MapStation = (station: Station): MapStation => ({
  id: station.id,
  name: station.name,
  state: station.state,
  type: station.type,
  category: station.category,
  latitude: Number(station.latitude),
  longitude: Number(station.longitude),
  azimuth: Number(station.direction),
  _raw: station,
});

export const StationList2MapStationList = (
  stationList: Station[],
): MapStation[] => stationList.map(Station2MapStation);
